package com.taplinker.client.core;

import java.util.ArrayList;
import java.util.List;

import com.taplinker.client.ActivityListen;

public class DataManager {
	private List<ActivityListen> mListener = new ArrayList<ActivityListen>();
	
	public void bindListener(ActivityListen listener) {
		if(!mListener.contains(listener)){
			mListener.add(listener);
		}
	}
	
	public void unbindListener(ActivityListen listener) {
		if(mListener.contains(listener)){
			mListener.remove(listener);
		}
	}
	
	public void noticeListener(String obj) {
		if(mListener != null) {
			for(ActivityListen listen : mListener) {
				listen.handleMessage(obj);
			}
		}
	}
}
